<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="http://schemas.microsoft.com/sharepoint/soap/">
   <xs:complexType name="ruleDesignerType">
      <xs:sequence>
         <xs:element name="FieldBind" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
               <xs:choice>
                  <xs:sequence>
                     <xs:element name="Option" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                           <xs:sequence>
                           </xs:sequence>
                           <xs:attribute name="Name" type="xs:string" use="required" />
                           <xs:attribute name="Value" type="xs:string" use="required" />
                           <xs:attribute name="TypeFilter" type="xs:string" />
                           <xs:attribute name="UnaryHides" type="xs:string" />
                        </xs:complexType>
                     </xs:element>
                  </xs:sequence>
                  <xs:element name="DataSourceRef" minOccurs="1" maxOccurs="unbounded">
                     <xs:complexType>
                        <xs:sequence />
                        <xs:attribute name="Ref" type="xs:string" />
                     </xs:complexType>
                  </xs:element>
               </xs:choice>
               <xs:attribute name="Field" type="xs:string" />
               <xs:attribute name="Text" type="xs:string" />
               <xs:attribute name="Id" type="xs:positiveInteger" use="required" />
               <xs:attribute name="DesignerType" use="required">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:enumeration value="AddPermission" />
                        <xs:enumeration value="Assignment" />
                        <xs:enumeration value="Bool" />
                        <xs:enumeration value="CheckPermission" />
                        <xs:enumeration value="ChooseDoclibItem" />
                        <xs:enumeration value="ChooseListItem" />
                        <xs:enumeration value="CreateListItem" />
                        <xs:enumeration value="DataSourceFieldNames" />
                        <xs:enumeration value="DataSourceValues" />
                        <xs:enumeration value="Date" />
                        <xs:enumeration value="Dependent" />
                        <xs:enumeration value="Dropdown" />
                        <xs:enumeration value="Email" />
                        <xs:enumeration value="FieldNames" />
                        <xs:enumeration value="Float" />
                        <xs:enumeration value="Hyperlink" />
                        <xs:enumeration value="Integer" />
                        <xs:enumeration value="ListNames" />
                        <xs:enumeration value="Operator" />
                        <xs:enumeration value="ParameterNames" />
                        <xs:enumeration value="Person" />
                        <xs:enumeration value="RemovePermission" />
                        <xs:enumeration value="ReplacePermission" />
                        <xs:enumeration value="SinglePerson" />
                        <xs:enumeration value="StatusDropdown" />
                        <xs:enumeration value="StringBuilder" />
                        <xs:enumeration value="Survey" />
                        <xs:enumeration value="TaskSummary" />
                        <xs:enumeration value="Text" />
                        <xs:enumeration value="TextBox" />
                        <xs:enumeration value="TextArea" />
                        <xs:enumeration value="UpdateListItem" />
                        <xs:enumeration value="WritableFieldNames" />
                     </xs:restriction>
                  </xs:simpleType>
               </xs:attribute>
               <xs:attribute name="OperatorTypeFrom" type="xs:string" />
               <xs:attribute name="TypeFrom" type="xs:string" />
               <xs:attribute name="Function" type="xs:boolean" default="false" />
               <xs:attribute name="Value" type="xs:string" />
            </xs:complexType>
         </xs:element>
      </xs:sequence>
      <xs:attribute name="Sentence" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="defaultElementType">
      <xs:sequence>
         <xs:element name="RuleDesigner" type="ruleDesignerType" />
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="parametersType">
      <xs:sequence>
         <xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
               <xs:sequence>
               </xs:sequence>
               <xs:attribute name="Name" type="xs:string" use="required" />
               <xs:attribute name="Type" type="xs:string" use="required" />
               <xs:attribute name="Direction" use="required">
                  <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:enumeration value="In" />
                        <xs:enumeration value="Out" />
                        <xs:enumeration value="Optional" />
                     </xs:restriction>
                  </xs:simpleType>
               </xs:attribute>
               <xs:attribute name="Description" type="xs:string" />
               <xs:attribute name="DesignerType">
                   <xs:simpleType>
                     <xs:restriction base="xs:string">
                        <xs:enumeration value="ContentType" />
                        <xs:enumeration value="DataSourceFieldNames" />
                        <xs:enumeration value="DataSourceValues" />
                        <xs:enumeration value="Date" />
                        <xs:enumeration value="Dependent" />
                        <xs:enumeration value="Dropdown" />
                        <xs:enumeration value="FieldNames" />
                        <xs:enumeration value="Hide" />
                        <xs:enumeration value="Integer" />
                        <xs:enumeration value="ItemProperties" />
                        <xs:enumeration value="ListItem" />
                        <xs:enumeration value="ListNames" />
                        <xs:enumeration value="ParameterNames" />
                        <xs:enumeration value="Person" />
                        <xs:enumeration value="SinglePerson" />
                        <xs:enumeration value="StatusDropdown" />
                        <xs:enumeration value="StringBuilder" />
                        <xs:enumeration value="TextArea" />
                        <xs:enumeration value="TextBox" />
                        <xs:enumeration value="WritableFieldNames" />
                     </xs:restriction>
                  </xs:simpleType>
               </xs:attribute>
               <xs:attribute name="DisplayName" type="xs:string" />
               <xs:attribute name="InitialValue" type="xs:string" />
               <xs:attribute name="InitialBinding" type="xs:string" />
            </xs:complexType>
         </xs:element>
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="dataSourcesType">
      <xs:sequence>
         <xs:element name="DataSource" type="dataSourceType" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="dataSourceType">
      <xs:sequence>
          <xs:element name="SchemaSource">
             <xs:complexType>
                <xs:choice>
                   <xs:element name="Fields" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                         <xs:sequence>
                            <xs:element name="Field" minOccurs="1" maxOccurs="unbounded">
                               <xs:complexType>
                                  <xs:attribute name="Name" type="xs:string" />
                                  <xs:attribute name="DisplayName" type="xs:string" />
                                  <xs:attribute name="Type" type="xs:string" />
                               </xs:complexType>
                            </xs:element>
                         </xs:sequence>
                      </xs:complexType>
                   </xs:element>
                   <xs:element name="ContentType" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                         <xs:attribute name="IDFrom" type="xs:string" />
                      </xs:complexType>
                   </xs:element>
                   <xs:element name="Dictionary" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                         <xs:attribute name="ValueFrom" type="xs:string" />
                      </xs:complexType>
                   </xs:element>
                   <xs:element name="NestedInitiationFieldNodes" minOccurs="0" maxOccurs="1" />
                </xs:choice>
             </xs:complexType>
          </xs:element>
          <xs:element name="Evaluation">
             <xs:complexType>
                <xs:choice>
                   <xs:element name="ActivitySource">
                      <xs:complexType>
                      </xs:complexType>
                   </xs:element>
                   <xs:element name="HashtableSource">
                      <xs:complexType>
                         <xs:attribute name="HashtableFrom" type="xs:string" />
                      </xs:complexType>
                   </xs:element>
                </xs:choice>
             </xs:complexType>
          </xs:element>
      </xs:sequence>
      <xs:attribute name="InternalName" type="xs:string" use="required" />
      <xs:attribute name="Name" type="xs:string" use="required" />
      <xs:attribute name="NameProperty" type="xs:string" use="required" />
   </xs:complexType>
   <xs:complexType name="actionType">
     <xs:all>
       <xs:element name="Parameters" type="parametersType" minOccurs="0" maxOccurs="1" />
       <xs:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
       <xs:element name="DataSources" type="dataSourcesType" minOccurs="0" maxOccurs="1" />
       <xs:element name="Modifications" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:element name="Modification" minOccurs="1" maxOccurs="unbounded">
               <xs:complexType>
                 <xs:sequence />
                 <xs:attribute name="TypeId" type="xs:string" use="required" />
                 <xs:attribute name="NameFormat" use="required">
                   <xs:simpleType>
                     <xs:restriction base="xs:string">
                       <xs:pattern value="([^\{]|\\\{|(\{0\}))*" />
                     </xs:restriction>
                   </xs:simpleType>
                 </xs:attribute>
                 <xs:attribute name="FormURN" type="xs:string" use="required" />
               </xs:complexType>
             </xs:element>
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element name="ActionVariables" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element name="ActionBody" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element name="ActionConditions" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
           </xs:sequence>
         </xs:complexType>
       </xs:element>
     </xs:all>
     <xs:attribute name="Name" type="xs:string" use="required" />
     <xs:attribute name="ClassName" type="xs:string" use="required" />
     <xs:attribute name="Assembly" type="xs:string" use="required" />
     <xs:attribute name="FunctionName" type="xs:string" default=""/>
     <xs:attribute name="Category" type="xs:string" />
     <xs:attribute name="CreatesTask" type="xs:boolean" default="false" />
     <xs:attribute name="CreatesInList" type="xs:string" />
     <xs:attribute name="AppliesTo" type="appliesToTypes" use="required" />
     <xs:attribute name="IsError" type="xs:boolean" default="false" />
     <xs:attribute name="ListModeration" type="xs:boolean" default="false" />
     <xs:attribute name="UsesCurrentItem" type="xs:boolean" default="false" />
     <xs:attributeGroup ref="invocationTagAttributeGroup"/>
     <xs:attribute name="CreatedTaskFormType">
       <xs:simpleType>
         <xs:restriction base="xs:string">
           <xs:enumeration value="DataCollectTask" />
           <xs:enumeration value="GroupAssignedTask" />
           <xs:enumeration value="TodoItemTask" />
           <xs:enumeration value="TaskProcess" />
         </xs:restriction>
       </xs:simpleType>
     </xs:attribute>
     <xs:attribute name="__SolutionId" type="xs:string" />
     <xs:attribute name="SandboxedFunction" type="xs:boolean" default="false" />
   </xs:complexType> 
   <xs:simpleType name="appliesToTypes">
      <xs:restriction base="xs:string">
         <xs:enumeration value="none" />
         <xs:enumeration value="list" />
         <xs:enumeration value="doclib" />
         <xs:enumeration value="all" />
         <xs:enumeration value="displayonly" />
      </xs:restriction>
   </xs:simpleType>
   <xs:attributeGroup name="invocationTagAttributeGroup">
      <xs:attribute name="RequiredInvocationTags" type="xs:string" />
      <xs:attribute name="InvocationTags" type="xs:string" />
      <xs:attribute name="ProhibitedInvocationTags" type="xs:string" />
   </xs:attributeGroup>
</xs:schema>